package com.example.im.ws;

import lombok.Data;
import org.springframework.web.socket.WebSocketSession;

/**
 * @ClassName SessionData
 * @Description web端管理session要用到的数据结构
 * @Author guchuanhang
 * @date 2025/1/25 13:59
 * @Version 1.0
 **/

@Data
public class SessionData {
    private int sessionType; // 1 master(app). 0 pc
    private String fileId; //pc会话ID
    private WebSocketSession session;
    private String sessionId;
    //虽然可以通过session.getId()获取到sessionId,但session关闭后,读取就会报错

    public SessionData(WebSocketSession session) {
        this.sessionType = 0;
        this.session = session;
        this.sessionId = session.getId();
    }
}
